package com.zj.dmsproxy.wrapper.condition;

import com.zj.dmsproxy.enums.QueryEnum;
import lombok.Getter;

import java.util.Collections;
import java.util.Map;

/**
 * @author 19242
 */
@Getter
public class RangeCondition extends AbstractCondition {

    private final QueryEnum queryEnum;

    private final Object value;

    public RangeCondition(String field, QueryEnum queryEnum, Object value) {
        super(false, field);
        this.queryEnum = queryEnum;
        this.value = value;
    }

    @Override
    public Map<String, Object> toCondition() {
        return Collections.singletonMap(getField(), Collections.singletonMap(QueryEnum.IN.getRelation(), getValue()));
    }
}
